package org.example.controller;

import jakarta.annotation.Resource;
import jakarta.websocket.server.PathParam;
import org.example.bean.Course;
import org.example.service.CourseService;
import org.example.util.JsonResult;
import org.springframework.web.bind.annotation.*;

/**
 * @Auther:Liu
 * @Testname:CourseController
 * @Date:2025/9/9 11:39
 */
@RestController
@RequestMapping("/course")
public class CourseController {
    @Resource
    private CourseService courseService;

    @PostMapping("/saveCourse")
    JsonResult SaveCourse(Course course) {
       return courseService.SaveCourse(course);
    }

    @GetMapping("/find_id/{no}")
    JsonResult findCourseById(@PathVariable("no") String no) {
        return courseService.findCourseById(no);
    }
}
